const gulp = require("gulp");
const sass = require("gulp-sass")(require('sass'));
const minifyCss = require("gulp-clean-css");
const renameCss = require("gulp-rename");

// gulp任务
gulp.task("scss", function () {
    return gulp.src("*.scss") // 编写的scss文件路径
        .pipe(sass()) //将scss编译成css
        .pipe(gulp.dest("dist")) //未压缩的css存放目录
        .pipe(minifyCss()) //压缩css
        .pipe(renameCss({suffix:'.min'})) //重命名压缩后的css
        .pipe(gulp.dest("dist")); //压缩后的css存放位置
})
